package com.cd2cd.mapper;

import com.cd2cd.domain.ProField;
import com.cd2cd.mapper.gen.SuperProFieldMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ProFieldMapper extends SuperProFieldMapper {
    @Select("select name,data_type dataType,type_path typePath,collection_type collectionType,comment from pro_field where file_id = #{fid}")
    List<ProField> selectByFileId(@Param("fid")Integer fid);

    @Select("select * from pro_field where file_id in (select id from pro_file where project_id = #{projectId})")
    @ResultMap("BaseResultMap")
    List<ProField> selectByProjectId(@Param("projectId") Long projectId);
}